home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9159 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  56 lines

  1. Path: seas.gwu.edu!spiffy
  2. From: spiffy@seas.gwu.edu (Marc Goldberg)
  3. Newsgroups: gwu.seas,comp.lang.c
  4. Subject: help: gcc
  5. Date: 8 Mar 1996 15:08:45 GMT
  6. Organization: George Washington University
  7. Message-ID: <4hpiht$1n2@cronkite.seas.gwu.edu>
  8. NNTP-Posting-Host: 128.164.9.3
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11.  
  12. Trying to compile a program on Solaris 2.5, I've removed all bugs (syntax 
  13. errors, at least) but these.  Any help would be *greatly* appreciated.
  14.  
  15. Thanks,
  16. --Marc
  17.  
  18. ~~~~~
  19. spiffy@felix:5: gcc 2FarmCheck.c 
  20. 2FarmCheck.c: In function `readHostFiles':
  21. 2FarmCheck.c:23: dereferencing pointer to incomplete type
  22. 2FarmCheck.c:25: dereferencing pointer to incomplete type
  23. 2FarmCheck.c:27: warning: passing arg 3 of `fgets' from incompatible 
  24.          pointer type
  25. 2FarmCheck.c: In function `main':
  26. 2FarmCheck.c:66: storage size of `PID' isn't known
  27. ~~~~~~
  28.  
  29. The lines referred to are:
  30.  
  31. char *readHostFiles(char *name)
  32.       {
  33.       int foo;
  34.       struct FILE *fileDisc;
  35.  
  36. (23)  *fileDisc = fopen("/users/spiffy/urls.txt", O_RDONLY);
  37.  
  38. (25)  while (!feof(fileDisc))
  39.         {
  40. (27)      if ( fgets(name, HOSTNAMESIZE, fileDisc) != name)
  41.           exit(12);
  42.         }
  43.       return name; 
  44.       } 
  45. |
  46. |
  47. |
  48. int main(void)
  49.       {
  50. (66)  struct pid_t PID;
  51.       char name[HOSTNAMESIZE];        /*Hostname of server to check on*/
  52.  
  53.       PID = getpid();
  54.       ...other stuff...
  55.       }
  56.